﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="System.Web.Mvc.ViewPage<TemplatedViewData>" %>
<script runat="server">

    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        jQueryScriptManager.Current.RegisterSource(Url.Asset("jsc.portal.core"));
        jQueryScriptManager.Current.RegisterSource(Url.Asset("jquery.ui"));
        GenerateHeaders();
    }

    private void GenerateHeaders()
    {
        if (string.IsNullOrEmpty(Page.Header.Title))
        {
            Page.Header.Title = Model.Title;
        }

        metaKeywords.Visible = !string.IsNullOrEmpty(Model.CurrentPage.MetaKeywords);
        metaKeywords.Content = Model.CurrentPage.MetaKeywords;
        metaDescription.Content = Model.CurrentPage.MetaDescription;

        //Remove the ugly server ID tag
        metaKeywords.ID = metaDescription.ID = null;

        metaKeywords.Visible = !string.IsNullOrEmpty(metaKeywords.Content);
        metaDescription.Visible = !string.IsNullOrEmpty(metaDescription.Content);
    }

</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en" lang="en">
<!--
//******************************************************************
//** Software development, CMS                                    **
//** JSC Portal                                                   **
//** JSC Projects                                                 **
//** www.jsc-projects.nl                                          **
//******************************************************************
-->
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta id="metaKeywords" runat="server" name="keywords" content=""/>
    <meta id="metaDescription" runat="server" name="description" content=""/>
    <link rel="Stylesheet" type="text/css" href="<%= Url.Asset("jsc.portal.core.css").Replace("&", "&amp;") %>" />
    <link rel="Stylesheet" type="text/css" href="<%= Url.Content(Model.CSS).Replace("&", "&amp;") %>" />
    <% if (User.Identity.IsAuthenticated) { %>
    <link rel="Stylesheet" type="text/css" href="<%= Url.Asset("jsc.portal.core.authenticated.css").Replace("&", "&amp;") %>"/>
    <% } %>
    <!--[if lte IE 7]>
    <style type="text/css">
        html .jqueryslidemenu{height: 1%;} /*Holly Hack for IE7 and below*/
    </style>
    <![endif]-->
    <script src="<%= Url.Asset("jquery.core").Replace("&", "&amp;") %>" type="text/javascript"></script>   
</head>
<body>

<% Html.RenderPartial(string.Format("{0}/{1}", ViewData.Model.Template.Path, ViewData.Model.Template.ControlName)); %>

<div id="modal-container" style="display: none;"></div>

<jsc:jQueryScriptManager id="scripts" runat="server"></jsc:jQueryScriptManager>

</body>
</html>